/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

import java.util.HashSet;
import java.util.Observable;
import java.util.Set;
import javax.swing.JButton;

/**
 *
 * @author Jelle
 */
public class ToolbarModel extends Observable {


    private Set<JButton> items = new HashSet<JButton>();

    public ToolbarModel(){}

    public void clearModel(){
        items.clear();
        adjustView();
    }

    public void addItem(JButton button){
        items.add(button);
        adjustView();
    }

    /**
     * @return the items
     */
    public Set<JButton> getItems() {
        return items;
    }

    /**
     * @param items the items to set
     */
    public void setItems(Set<JButton> items) {
        this.items = items;
        adjustView();
    }

    protected void adjustView() {
        setChanged();
        notifyObservers();
    }

}
